public static void main(String[] args) {
    QuadSolver solver = new QuadSolver(1, -3, 2);
    double[] solution = solver.solve();

    if (solution[1] == 0) {
        System.out.println("实数解: " + solution[0]);
    }
    else
    {
        // 复数解
        System.out.println("复数解: " + solution[0] + " + " + solution[1] + "i");
        System.out.println("         " + solution[0] + " - " + solution[1] + "i");
    }
}